Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: sudo defaults rule #7255

Closed
wants to merge 1 commit into from
Closed

Tests: sudo defaults rule #7255

wants to merge 1 commit into from

Conversation

shridhargadekar
Copy link
Contributor

A sudo rule with specifically 'defaults' as cn is being tested. The addition option '!authenticate' has been added. The man 5 sudoers.ldap says:

Sudo first looks for the ‘cn=defaults’ entry in the SUDOers container. If found, the multi-valued sudoOption attribute is parsed in the same manner as a global Defaults line in /etc/sudoers. In the following example, the SSH_AUTH_SOCK variable will be preserved in the environment for all users.

   dn: cn=defaults,ou=SUDOers,dc=my-domain,dc=com
   objectClass: top
   objectClass: sudoRole
   cn: defaults
   description: Default sudoOption's go here
   sudoOption: env_keep+=SSH_AUTH_SOCK

Copy link
Member

@pbrezina pbrezina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Shridhar, there is flake error:

./tests/test_sudo.py:575:120: E501 line too long (122 > 119 characters)

Otherwise it looks good to me. Thank you.

Copy link
Contributor

@jakub-vavra-cz jakub-vavra-cz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-root

src/tests/system/tests/test_sudo.py Outdated Show resolved Hide resolved
@shridhargadekar shridhargadekar force-pushed the sudo-defaults branch 3 times, most recently from 9884f2b to 1856bef Compare April 4, 2024 09:51
src/tests/system/tests/test_sudo.py Outdated Show resolved Hide resolved
@shridhargadekar shridhargadekar force-pushed the sudo-defaults branch 2 times, most recently from 19e4f9d to 6e90832 Compare April 9, 2024 14:01
Copy link
Contributor

@jakub-vavra-cz jakub-vavra-cz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice clear and simple tests.

Changed doc-strings and steps for more clarity
@jakub-vavra-cz
Copy link
Contributor

Pushed PR: #7255

  • master
    • fa9f688 - Tests: sudo defaults rule
  • sssd-2-9
    • 925cb2a - Tests: sudo defaults rule

@shridhargadekar shridhargadekar deleted the sudo-defaults branch December 2, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants